<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
<link rel="stylesheet" href="__PUBLIC__/css/reset.css">
<link rel="stylesheet" href="__PUBLIC__/css/index.css">
</head>
<body>
    

    <header>
        <h1><a href="{:U('home/index/index')}">My Blog</a></h1>
        <h4>所有的伟大，源于一个勇敢的开始.</h4>
    </header>
    
    <nav> 
        <ul>
            <foreach name="top" item="value">
            <li><a href="{:U('home/index/nav',array('cat_id'=>$value['cat_id'],'catname'=>$value['catname']))}">{$value['catname']}</a></li>
            </foreach>
        </ul>
    </nav>
    <div id="main">
        <div id="lside">


        <foreach name="art" item="value">
            <article>
                <h2><a href="{:U('home/index/art',array('art_id'=>$value['art_id']))}">{$value['title']}</a></h2>
                <div class="entry_header">
                    <time>{$value['pubtime']}</time>
                    by
                    <a href="#">Mr.z</a>
                    <span class="catlink" >{$value['cat_id']}</span>
                    <span class="comment" >{$value['comm']}</span>
                </div>
                <div class="entry_content">
                {$value['content']}
                </div>
            </article>
            </foreach>
        
            <div id="pagebar">
            {$page}
            </div>
        </div>
        <div id="rside">

            <aside>
                <form action="">
                    <input type="text" name="search" placeholder="Search..." id="one1">
                </form>
            </aside>

            <aside>
                <if condition="cookie_check() eq 1">
            
                <h4>你登录啦~~</h4>
                <ul>
                    <li>你好,{$Think.cookie.username}</li>
                    <br/>
                    下面可以换头像
                </ul>
                <br/>
                <img src={$pic['pic']} alt="">
                <br>

                <form action="{:U('home/index/pic')}" method="post" enctype="multipart/form-data">
                    
                    <input type="file" name="picture">
                    <br>
                    <br>
                    <input type="submit" value="提交">

                </form>

                <else />

                <img src="__PUBLIC__/flower.jpg" alt="" style="position:relative; left:60px;">
                <br>
                <br>
                <h3>&nbsp&nbsp加油，希望每天都像花儿一样美。</h3>

            </if>
                
            </aside>
            
            <aside>
                
                    <h4>今日天气</h4>
                    <ul>
                    <li>{$weather['string'][1]}</li><br/>
                    
                    <li>{$weather['string'][6]}</li><br/>

                    <li>{$weather['string'][10]}</li><br/>
                    </ul>
                
            </aside>

            <aside>
                <h4>最新文章</h4>
                <ul>
                <foreach name="hot" item="value">
                    <li><a href="{:U('home/index/art',array('art_id'=>$value['art_id']))}">{$value['title']}</a>&nbsp;&nbsp;({$value['comm']})</li>
                </foreach>
                </ul>
            </aside>
            
            <if condition="cookie_check() eq 1">
            <aside>
                <form action="">
                    <h4>只能评论哦~</h4>
                    <ul>
                    <li><a href="{:U('home/user/register')}">注册</a></li>
                    <br/>                    
                    <li><a href="{:U('home/user/logout')}">退出登录</a></li>
                    </ul>
                </form>
            </aside>            
            <else />
            <aside>
                <form action="">
                    <h4>只能评论哦~</h4>
                    <ul>
                    <li><a href="{:U('home/user/login')}">登录</a></li>
                    <br/>
                    <li><a href="{:U('home/user/register')}">注册</a></li>
                    </ul>
                </form>
            </aside>
            </if>
            
            <!-- <if condition="$Think.cookie.username eq admin"> --> 

            <!-- 此处用于限制，不是admin的用户无法进入后台显示 -->
            
            <!-- <else /> -->

            <!-- </if> -->
                <aside>
                
                    <h4>后台入口</h4>
                    <ul>
                    <li><a href="{:U('admin/art/artlist')}">进入</a></li><br/>
                    </ul>
                
                 </aside>


            
        </div>
    </div>
    <footer>
        Copyright &copy; 2015 · GeneratePress · WordPress
    </footer>
</body>
</html>